<?php
class Article_Controller_Article {
	
	public $template;
	
	public function main(array $getVars, array $postVars){
		
		if(isset($getVars['page'])){
			$articleModel = new Article_Model_Singlearticle;
			$article = $articleModel->getArticle($getVars, $postVars);
			$this->template = "./article/views/singlearticle.php";
		}
		else {
			$articleModel = new Article_Model_Articlelist;
			$article = $articleModel->getArticleList($getVars);
			$this->template = "./article/views/articlelist.php";
		}
		$view = new Core_Model_View($this->template);
		$view->assign('article', $article);
	}
	
}